package com.ybxx.config.service.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.ybxx.config.dao.HouseTypDao;
import com.ybxx.config.model.HouseType;
import com.ybxx.config.service.HouseTypeService;
import com.ybxx.core.command.QueryFilter;
import com.ybxx.core.dao.GenericDao;
import com.ybxx.core.service.impl.BaseServiceImpl;
import com.ybxx.core.web.paging.PagingBean;
import com.ybxx.hr.model.Dept;

public class HouseTypeServiceImpl extends BaseServiceImpl<HouseType> implements
		HouseTypeService {
	private HouseTypDao houseTypeDao;
	public HouseTypeServiceImpl(HouseTypDao dao) {
		super(dao);
		this.houseTypeDao=dao;
		// TODO Auto-generated constructor stub
	}
	public List<HouseType> queryPage(HouseType houseType,QueryFilter filter) {
		String hql="from HouseType ht";
		String condition=" where ";
		if(houseType!=null && StringUtils.isNotEmpty(houseType.getHname())){
			hql+=condition+" ht.hname='"+houseType.getHname()+"' ";
		}
		return houseTypeDao.findByHql(hql, null,filter.getPagingBean());
	}
}
